module.exports = {
    methods: {
        toHouseBindingView(){
            uni.navigateTo({
                url:'/pages/houseBinding/HouseBindingView'
            })
        },
        upper: function (e) {
            console.log(e)
        },
        lower: function (e) {
            console.log(e)
        },
        scroll: function (e) {
            console.log("e");
        },

        //生成随机渐变背景
        getGradientColor() {
            //生成随机颜色值
            const letters = '0123456789ABCDEF';
            let color1 = '#';
            let color2 = '#';
            for (let i = 0; i < 6; i++) {
                color1 += letters[Math.floor(Math.random() * 16)];
                color2 += letters[Math.floor(Math.random() * 16)];
            }
            //随机角度
            const angle = Math.floor(Math.random() * 360);
            return `linear-gradient(${angle}deg, ${color1}, ${color2})`;
        },
    },

    onLoad() {
        this.gradientColor = this.getGradientColor();
    },

    data() {
        return {
            gradientColor: '',
        }
    },
}
